package com.anli1.entity.pojo;

public class SyncMessage<T> {

    private String key;
    private T value;

    private SyncMessage(Builder<T> builder) {
        this.key = builder.key;
        this.value = builder.value;
    }

    public String getKey() {
        return key;
    }

    public T getValue() {
        return value;
    }

    public static <T> Builder<T> builder() {
        return new Builder<>();
    }

    public static class Builder<T> {
        private String key;
        private T value;

        public Builder<T> key(String key) {
            this.key = key;
            return this;
        }

        public Builder<T> value(T value) {
            this.value = value;
            return this;
        }

        public SyncMessage<T> build() {
            return new SyncMessage<>(this);
        }
    }
}
